﻿using IntoTheVoid.Units;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;

namespace IntoTheVoid.Converters
{
	class ResumeGameConverter : IValueConverter
	{
		object IValueConverter.Convert(object value, Type targetType, object parameter, CultureInfo culture)
		{
			if (value == null || parameter == null)
				return false;

		//	LogHelper.Log($"value:{value.ToString().ToLower()},parameter:{parameter.ToString()}");
		//	LogHelper.Log($"value222:{value.ToString().ToLower() == parameter.ToString()}");
			var sign =  value.ToString().ToLower() == parameter.ToString();
			return sign ? Visibility.Visible : Visibility.Hidden;
		}

		object IValueConverter.ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
		{
			return true;
		}
	}

	class AdvertRadioBtConvter : IValueConverter
	{
		public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
		{
			return value == null ? false : value.Equals(parameter);
		}

		public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
		{
			return value != null && value.Equals(true) ? parameter : Binding.DoNothing;
		}
	}
}
